/** Print a text file entry onto STDOUT. Default entry to MANIFEST.MF. */
object PrintJar {
	def main(args : Array[String]) : Unit = {
		val filename = args(0)
		val entryname = if (args.length >=2) args(1) else "META-INF/MANIFEST.MF"
		val jarfile = new java.util.jar.JarFile(filename)
		val entry = jarfile.getEntry(entryname)
		val istream = jarfile.getInputStream(entry)
		//io.Source.fromInputStream(istream).getLines().foreach { line => println(line) }
		io.Source.fromInputStream(istream).foreach { ch => print(ch) }
	}
}